<?php

namespace common\validate;


use think\Validate;

class LoginValidate extends Validate
{
    protected $rule = [
        'user'          => 'require',
        'pass'          => 'require',
        'remember_pass' => 'require|in:0,1',
        'is_encrypt'    => 'require|in:0,1',
        'come_from'     => 'in:pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios',
    ];

    protected $message = [
        'user.require'          => '账号为空',
        'pass.require'          => '密码为空',
        'remember_pass.require' => '记住密码参数必传，参数值是0或1',
        'remember_pass.in'      => '记住密码参数值只能为0或1',
        'is_encrypt.require'    => '是否加密参数必填，参数值是布尔值',
        'is_encrypt.in'         => '是否加密参数只能为0或1',
    ];
}